package com.rainbow.modules.quartztest;

import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.util.Date;

/**
 * Auth rainbow
 * 带参数定时任务
 */
@Slf4j
public class SampleParamJob implements Job {
    /**
     * 若参数变量名修改 QuartzJobController中也需对应修改
     */
    private String parameter;

    public void setParameter(String parameter) {
        this.parameter = parameter;
    }

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        log.info("带参数定时任务，时间" + new Date() + "{}", this.parameter);
    }
}
